﻿using Newtonsoft.Json.Linq;
using System;
using System.Collections.Generic;
using System.Dynamic;
using System.Linq;
using System.Reflection.PortableExecutable;
using System.Text;
using System.Threading.Tasks;

namespace Jim.K3Cloud;

/// <summary>
/// 单据查询
/// </summary>
[Sdk("Kingdee.BOS.WebApi.ServicesStub.DynamicFormService.View", "单据查询")]
public class K3CloudViewRequest : IK3CloudViewRequest<K3CloudViewResponse>
{
    /// <summary>
    /// 表单ID，必填
    /// </summary>
    [Required(ErrorMessage= "表单ID不能为空")]
    public string FormId { get; set; }
    /// <summary>
    /// 创建者组织内码（非必录）
    /// </summary>
    public int CreateOrgId { get; set; } = 0;
    /// <summary>
    /// 单据编码，字符串类型（使用编码时必录）
    /// </summary>
    public string Number { get; set; } = string.Empty;
    /// <summary>
    /// 表单内码（使用内码时必录）
    /// </summary>
    public string Id { get; set; } = string.Empty;
    /// <summary>
    /// 单据体是否按序号排序，默认false
    /// </summary>
    public bool IsSortBySeq { get; set; } = false;

    public object QueryParams()
    {
        return new
        {
            FormId = FormId,
            Data = new
            {
                CreateOrgId = CreateOrgId,
                Numbe = Number,
                Id = Id,
                IsSortBySe = IsSortBySeq
            }
        };
    }

    public void Validate()
    {
    }
}


public class K3CloudViewResponse: SdkResponse<object>
{
}
